﻿
using RsaRegister;
using RsaRegister.Model;
using SoftRegManager.Model;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace SoftRegManager.BLL
{
    public partial class GreatBLL
    {
        public ISugarQueryable<RegInfo> GetSoftRegInfoes()
        {
            return mDbClient.Queryable<RegInfo>();
        }
        public RegInfo GetSoftRegInfo(Guid id)
        {
            
            return GetSoftRegInfoes().Single(s => s.Id == id);
        }
        public RegInfo SaveRegInfo(RegInfo regInfo)
        {
            if (regInfo.Id == Guid.Empty) regInfo.Id = Guid.NewGuid();
            regInfo.LastUpdated = mDbClient.GetDate();
            return mDbClient.Saveable(regInfo).ExecuteReturnEntity();
        }

        
    }
}
